import { Module } from '@nestjs/common';
import { AuthService } from '../services/auth/auth.service';
import { PassportModule } from '@nestjs/passport';
import { LocalStrategy } from "../api/auth/local.strategy";
import { AuthController } from '../api/auth/auth.controller';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants } from '../api/auth/constants';
import { JwtStrategy } from "../api/auth/jwt.strategy";
import { UsersModule } from "./users.module";

@Module({
  providers: [AuthService,LocalStrategy,JwtStrategy],
  imports:[
    UsersModule,
    PassportModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: '2h' },
    })
  ],
  controllers: [AuthController],
  exports:[AuthService]
})
export class AuthModule {}
